vInterapplication CommunicationContentsFigures, Tables, and ListingsAbout This BookFormat of a Typical ChapterConventions Used in This BookSpecial FontsTypes of NotesAssembly-Language InformationThe Development Environment.Introduction to Interapplication Communication*Overview of Interapplication CommunicationBFigure 1-1 Principal methods of communication between applicationsSharing Data Among Applications;Figure 1-2 Sharing data with the aid of the Edition Manager4Figure 1-3 A publisher, an edition, and a subscriber7Figure 1-4 Sharing dynamic data with other applications&Sending and Responding to Apple EventsYFigure 1-5 Sending and responding to Apple events with the aid of the Apple Event ManagerStandard Apple EventsHandling Apple EventsFigure 1-6 A Set Data event4Supporting AppleScript and Other Scripting Languages6Figure 1-7 How a scripting component executes a scriptScriptable Applications8Figure 1-8 A Set Data event sent during script executionRecordable Applications;Figure 1-9 Recording user actions in a factored application0Applications That Manipulate and Execute ScriptsKFigure 1-10 Controlling an application’s own behavior by executing a scriptLFigure 1-11 Posting an invoice and updating a database by executing a scriptExchanging Message BlocksEdition Manager5Introduction to Publishers, Subscribers, and Editions#Figure 2-1 The default edition icon4Figure 2-2 A publisher, an edition, and a subscriber#Figure 2-3 The publisher dialog box$Figure 2-4 The subscriber dialog box4Figure 2-5 A document and its corresponding editions+Figure 2-6 Publisher and subscriber borders4Figure 2-7 Edition Manager commands in the Edit menuEFigure 2-8 Edition Manager commands under the Publishing menu commandAbout the Edition ManagerUsing the Edition Manager/Receiving Apple Events From the Edition ManagerRListing 2-1 Accepting Section Read events and verifying if a section is registered,Creating the Section Record and Alias RecordKFigure 2-9 A document with a publisher and subscriber and its resource fork%Saving a Document Containing Sections'Figure 2-10 The new publisher alert box1Listing 2-2 Saving a document containing sections2Opening and Closing a Document Containing Sections2Listing 2-3 Opening a document containing sectionsReading and Writing a SectionFormats in an EditionOpening an EditionFormat Marks Reading and Writing Edition DataClosing an EditionCreating a Publisher)Figure 2-11 A sample publisher dialog boxCreating the Edition Container Listing 2-4 Creating a publisher*Opening an Edition Container to Write Data&Listing 2-5 Writing data to an editionCreating a Subscriber*Figure 2-12 A sample subscriber dialog box!Listing 2-6 Creating a subscriber)Opening an Edition Container to Read Data%Choosing Which Edition Format to Read#Listing 2-7 Reading in edition data&Using Publisher and Subscriber OptionsLFigure 2-13 The publisher options dialog box with update mode set to On SaveNFigure 2-14 The publisher options dialog box with update mode set to Manually TFigure 2-15 The subscriber options dialog box with update mode set to Automatically NFigure 2-16 The subscriber options dialog box with update mode set to Manually&Listing 2-8 Responding to action codes1Publishing a New Edition While Saving or Manually3Subscribing to an Edition Automatically or Manually#Canceling Sections Within Documents)Locating a Publisher Through a Subscriber'Renaming a Document Containing Sections+Displaying Publisher and Subscriber Borders9Figure 2-17 Edit menu with Show/Hide Borders menu commandFigure 2-18 Publisher bordersFigure 2-19 Subscriber bordersText Borders-Figure 2-20 A publisher with contents removedSpreadsheet Borders<Figure 2-21 A publisher border within a spreadsheet document Object-Oriented Graphics Borders2Figure 2-22 A publisher border with resize handles<Figure 2-23 A publisher and subscriber with clipped graphicsBitmapped Graphics Borders&Duplicating Publishers and Subscribers2Figure 2-24 Creating multiple publishers alert box0Figure 2-25 Saving multiple publishers alert boxModifying a SubscriberRelocating an EditionCustomizing Dialog Boxes Subscribing to Non-Edition Files1Figure 2-26 Subscribing directly to a 'PICT' file"Getting the Current Edition OpenerSetting an Edition OpenerCalling an Edition Opener2Listing 2-9 Using your own edition opener functionOpening and Closing Editions'Listing Files That Can Be Subscribed To!Reading From and Writing to FilesCalling a Format I/O FunctionEdition Manager ReferenceData StructuresThe Edition Container RecordThe Section RecordEdition Manager Routines Initializing the Edition Manager"Creating and Registering a Section*Creating and Deleting an Edition Container!Setting and Getting a Format MarkReading in Edition DataWriting out Edition Data+Closing an Edition After Reading or WritingDisplaying Dialog Boxes2Locating a Publisher and Edition From a SubscriberEdition Container Formats%Reading and Writing Non-Edition FilesApplication-Defined RoutinesSummary of the Edition ManagerIntroduction to Apple EventsAbout Apple Events"Figure 3-1 An Open Documents event$Apple Events and Apple Event ObjectsFigure 3-2 A Get Data event%Apple Event Attributes and ParametersApple Event AttributesApple Event Parameters2Interpreting Apple Event Attributes and ParametersKFigure 3-3 Major attributes and direct parameter of an Open Documents eventDFigure 3-4 Major attributes and direct parameter of a Get Data event#Data Structures Within Apple EventsDescriptor RecordsQFigure 3-5 A descriptor record whose data handle refers to an unterminated stringKFigure 3-6 A descriptor record whose data handle refers to event class data$Keyword-Specified Descriptor RecordsiFigure 3-7 A keyword-specified descriptor record for the event class attribute of an Open Documents eventDescriptor Lists2Figure 3-8 A descriptor list for a list of aliases9Figure 3-9 Data structures within an Open Documents eventResponding to Apple Events%Accepting and Processing Apple Events<Figure 3-10 Accepting and processing an Open Documents eventSFigure 3-11 The Apple Event Manager calling the handler for an Open Documents eventAbout Apple Event HandlersExtracting and Checking DataInteracting With the User6Performing the Requested Action and Returning a Result3Figure 3-12 Responding to an Open Documents event !Creating and Sending Apple EventsCreating an Apple Event Record,Adding Apple Event Attributes and Parameters-Sending an Apple Event and Handling the Reply%Working With Object Specifier Records1Data Structures Within an Object Specifier RecordCFigure 3-13 Data structures within a simple object specifier record:Figure 3-14 An object specifier record in a Get Data event)The Classification of Apple Event ObjectsObject Classes'Figure 3-15 Superclasses and subclassesProperties and ElementsOFigure 3-16 The object class inheritance hierarchy for the object class cWindowgFigure 3-17 An Apple event object of class cWord contained in an Apple event object of class cParagraphFinding Apple Event ObjectsAbout the Apple Event Manager/Supporting Apple Events as a Server Application/Supporting Apple Events as a Client ApplicationSupporting Apple Event Objects Supporting Apple Event RecordingResponding to Apple EventsHandling Apple EventsAccepting an Apple EventListing 4-1 A DoEvent procedure^Listing 4-2 A DoHighLevelEvent procedure for handling Apple events and other high-level events5Installing Entries in the Apple Event Dispatch Tables0Installing Entries for the Required Apple EventsgListing 4-3 Adding entries for the required Apple events to an application’s Apple event dispatch table?Installing Entries for Apple Events Sent by the Edition ManagervListing 4-4 Adding entries for Apple events sent by the Edition Manager to an application’s Apple event dispatch table!How Apple Event Dispatching Works"Handling the Required Apple EventsRequired Apple Events#Handling the Open Application Event4Listing 4-5 A handler for the Open Application event!Handling the Open Documents Event2Listing 4-6 A handler for the Open Documents event"Handling the Print Documents Event3Listing 4-7 A handler for the Print Documents event#Handling the Quit Application Event4Listing 4-8 A handler for the Quit Application event1Handling Apple Events Sent by the Edition Manager:The Section Read, Section Write, and Section Scroll Events#Handling the Create Publisher Event4Listing 4-9 A handler for the Create Publisher event"Getting Data Out of an Apple Event,Getting Data Out of an Apple Event Parameter Getting Data Out of an Attribute%Getting Data Out of a Descriptor List4Listing 4-10 Extracting items from a descriptor listWriting Apple Event HandlersHListing 4-11 A function that checks for a keyMissedKeywordAttr attributeReplying to an Apple EventIListing 4-12 Adding the keyErrorString parameter to the reply Apple event7Listing 4-13 Adding parameters to the reply Apple event(Disposing of Apple Event Data Structures(Writing and Installing Coercion HandlersJTable 4-1 Coercion handling provided by the Apple Event Manager(continued)Interacting With the User=Setting the Client Application’s User Interaction Preferences=Setting the Server Application’s User Interaction PreferencesRequesting User Interaction2Listing 4-14 Using the AEInteractWithUser functionBFigure 4-1 A document with a button that triggers a Get Data event_Figure 4-2 A server application displaying a dialog box that requests information from the user$Figure 4-3 Handling user interactionCFigure 4-4 Handling user interaction with the kAEWaitReply flag setFFigure 4-5 Handling user interaction with the kAEQueueReply flag set 'Reference to Responding to Apple Events/Data Structures Used by the Apple Event Manager.Descriptor Records and Related Data StructureszTable 4-2 Descriptor types used by the Apple Event Manager (excluding those used with object specifier records)(continued)Apple Event Array Data Types'Routines for Responding to Apple Events5Creating and Managing the Apple Event Dispatch TablesDispatching Apple EventsOGetting Data or Descriptor Records Out of Apple Event Parameters and Attributes&Counting the Items in Descriptor Lists#Getting Items From Descriptor ListsGGetting Data and Keyword-Specified Descriptor Records Out of AE RecordsRequesting User Interaction/Requesting More Time to Respond to Apple Events,Suspending and Resuming Apple Event Handling<Getting the Sizes and Descriptor Types of Descriptor RecordsDeleting Descriptor Records*Deallocating Memory for Descriptor RecordsCoercing Descriptor Types:Creating and Managing the Coercion Handler Dispatch Tables9Creating and Managing the Special Handler Dispatch Tables1Getting Information About the Apple Event ManagerApplication-Defined Routines%Summary of Responding to Apple Events!Creating and Sending Apple EventsCreating an Apple Event#Adding Parameters to an Apple Event1Specifying Optional Parameters for an Apple EventHListing 5-1 Creating the optional keyword for the Create Publisher eventSpecifying a Target Address%Creating an Address Descriptor Record%Listing 5-2 Creating a target addressZListing 5-3 Specifying a target address in an Apple event by using the PPCBrowser function0Addressing an Apple Event for Direct DispatchingSending an Apple Event"Listing 5-4 Sending an Apple eventDealing With TimeoutsWriting an Idle FunctionListing 5-5 An idle functionWriting a Reply Filter Function.Reference to Creating and Sending Apple Events.Routines for Creating and Sending Apple EventsCreating Apple Events+Creating and Duplicating Descriptor Records(Creating Descriptor Lists and AE Records Adding Items to Descriptor Lists0Adding Data and Descriptor Records to AE Records0Adding Parameters and Attributes to Apple EventsSending Apple EventsApplication-Defined Routines,Summary of Creating and Sending Apple Events/Resolving and Creating Object Specifier Records"Resolving Object Specifier RecordsIFigure 6-1 Resolving an object specifier record for a table in a document3Descriptor Records Used in Object Specifier RecordsObject Class ContainerMFigure 6-2 Nested object specifier records that specify a container hierarchyKey FormKey DataETable 6-1 Standard descriptor types used with keyAEKeyData(continued)Key Data for a Property IDKey Data for an Object’s NameKey Data for a Unique IDKey Data for Absolute PositionKey Data for Relative PositionKey Data for a TestETable 6-2 Keyword-specified descriptor records for typeCompDescriptorHTable 6-3 Keyword-specified descriptor records for typeLogicalDescriptorQFigure 6-3 The container hierarchy for the first row in a table that meets a test<Figure 6-4 A logical descriptor record that specifies a testKey Data for a RangeaTable 6-4 Keyword-specified descriptor records in a descriptor record of type typeRangeDescriptor9Installing Entries in the Object Accessor Dispatch TablesBInstalling Object Accessor Functions That Find Apple Event Objects~Listing 6-1 Installing object accessor functions that find elements of different classes for container tokens of the same type}Listing 6-2 Installing one object accessor function that finds elements of different classes for container tokens of one type}Listing 6-3 Installing object accessor functions that find elements of the same class for container tokens of different typessListing 6-4 Installing object accessor functions that locate elements of different classes in the default container9Installing Object Accessor Functions That Find Properties!Writing Object Accessor Functions?Writing Object Accessor Functions That Find Apple Event ObjectsbListing 6-5 An object accessor function that locates Apple event objects of object class cDocumentcListing 6-6 An object accessor function that locates Apple event objects of object class cParagraph^Listing 6-7 An object accessor function that locates Apple event objects of object class cWord`Listing 6-8 An object accessor function that locates Apple event objects of object class cWindow6Writing Object Accessor Functions That Find PropertiesPListing 6-9 An object accessor function that identifies any property of a windowDefining TokensXFigure 6-5 Descriptor record for an application-defined token that identifies a documentnFigure 6-6 Descriptor record for an application-defined token that identifies the pbounds property of a windowHandling Whose TestsFTable 6-5 Keyword-specified descriptor records for typeWhoseDescriptorcFigure 6-7 A container hierarchy created by the Apple Event Manager using a whose descriptor recordATable 6-6 Keyword-specified descriptor records for typeWhoseRange!Writing Object Callback Functions#Writing an Object-Counting Function(Listing 6-10 An object-counting function%Writing an Object-Comparison FunctionMListing 6-11 Object-comparison function that compares two Apple event objects"Writing Marking Callback Functions!Creating Object Specifier RecordsMTable 6-7 Nested object specifier records that describe a container hierarchy)Creating a Simple Object Specifier RecordIListing 6-12 Creating an object specifier record using CreateObjSpecifierHListing 6-13 Using CreateObjSpecifier in an application-defined function"Specifying the Container Hierarchy,Listing 6-14 Specifying a document container)Listing 6-15 Specifying a table containerSpecifying a PropertySpecifying a Relative Position*Creating a Complex Object Specifier RecordSpecifying a TestfTable 6-8 Object specifier record for the first row that meets a test in the table named “MyAddresses”9Table 6-9 Logical descriptor record that specifies a testKListing 6-16 Creating an object specifier record with the key form formName4Listing 6-17 Creating a comparison descriptor record1Listing 6-18 Creating a logical descriptor record7Listing 6-19 Creating a complex object specifier recordSpecifying a Range$Table 6-10 A range descriptor record/Listing 6-20 Creating a range descriptor record<Reference to Resolving and Creating Object Specifier Records0Data Structures Used in Object Specifier Records]Table 6-11 Keyword-specified descriptor records for typeObjectSpecifier(continued)(continued)<Routines for Resolving and Creating Object Specifier Records'Initializing the Object Support Library?Setting Object Accessor Functions and Object Callback Functions8Getting, Calling, and Removing Object Accessor Functions"Resolving Object Specifier RecordsDeallocating Memory for Tokens!Creating Object Specifier RecordsApplication-Defined RoutinesObject Accessor FunctionsObject Callback Functions:Summary of Resolving and Creating Object Specifier RecordsIntroduction to Scripting&About Scripts and Scripting ComponentsScript Editors and Script Files;Figure 7-1 A script window in the Script Editor applicationIFigure 7-2 Script file icons in the Finder and corresponding user actions0Scripting Components and Scriptable Applications:Figure 7-3 How the AppleScript component executes a script:Scripting Components and Applications That Execute ScriptsPFigure 7-4 How an application uses the AppleScript component to execute a script"Making Your Application Scriptable'About Apple Event Terminology Resources,How AppleScript Uses Terminology InformationpFigure 7-5 Role of the 'aete' and 'aeut' resources when the AppleScript component compiles and executes a scriptqFigure 7-6 Role of the 'aete' and 'aeut' resources when the AppleScript component records and decompiles a script*Dynamic Loading of Terminology Information"Making Your Application Recordable"Manipulating and Executing Scripts3Compiling, Saving, Modifying, and Executing Scripts/Using a Script Context to Handle an Apple EventGFigure 7-7 Using a handler in a script context to handle an Apple event!Apple Event Terminology Resources9Defining Terminology for Use by the AppleScript ComponentOTable 8-1 Syntax for AppleScript arguments that correspond to direct parameterscTable 8-2 Syntax for AppleScript arguments that correspond to insertion location descriptor records.Structure of Apple Event Terminology Resources6Table 8-3 Structure of the 'aeut' and 'aete' resources?Listing 8-1 Resource type declaration for the 'aeut' resource 6Creating an Apple Event Terminology Extension Resource-Supporting Standard Suites Without Extensions|Listing 8-2 Rez input for an 'aete' resource for an application that supports the Required and Core suites in their entiretyExtending the Standard SuitespListing 8-3 Rez input for an 'aete' resource that extends the definitions of the Required, Core, and Text suitesSupporting Subsets of SuitesSupporting New SuitesHandling the Get AETE Event-Listing 8-4 A handler for the Get AETE event .Reference to Apple Event Terminology Resources4Figure 8-1 Structure of an 'aeut' or 'aete' resource3Header Data for an Apple Event Terminology ResourceGFigure 8-2 Structure of the header data in an 'aeut' or 'aete' resource2Suite Data for an Apple Event Terminology ResourceBFigure 8-3 Structure of suite data in an 'aeut' or 'aete' resource
Event DataBFigure 8-4 Structure of event data in an 'aeut' or 'aete' resourceQFigure 8-5 Structure of additional parameter data in an 'aeut' or 'aete' resourceObject Class DataJFigure 8-6 Structure of object class data in an 'aeut' or 'aete' resource EFigure 8-7 Structure of property data in an 'aeut' or 'aete' resourceJFigure 8-8 Structure of element class data in an 'aeut' or 'aete' resourceComparison Operator DataQFigure 8-9 Structure of comparison operator data in an 'aeut' or 'aete' resource Enumeration and Enumerator Data IFigure 8-10 Structure of enumeration data in an 'aeut' or 'aete' resourceHFigure 8-11 Structure of enumerator data in an 'aeut' or 'aete' resourceThe Scripting Size Resource=Listing 8-5 Resource type declaration for the 'scsz' resourceRecording Apple EventsAbout Recordable Applications(Factoring Your Application for Recording.Factoring the Quit Command and the New Command]Listing 9-1 A function used by a factored application to send itself a Quit Application eventWListing 9-2 A routine used by a factored application to handle a Quit Application eventZListing 9-3 A routine used by a factored application to send itself a Create Element eventGListing 9-4 The Create Element event handler for a factored application+Sending Apple Events Without Executing ThemNListing 9-5 A routine used by a factored application to handle window movementWhat to RecordRecording User Actions'Recording the Selection of Text ObjectsRecording Insertion PointsRecording Typing*Recording the Selection of Nontext ObjectsIdentifying Objects%Moving the Selection During Recording(Recording Interactions With Dialog BoxesHow Apple Event Recording WorksScripting Components#Connecting to a Scripting ComponentTListing 10-1 Locating a scripting component that supports specific optional routines"Using Scripting Component Routines#Compiling and Executing Source Data=Listing 10-2 A routine that compiles and executes source data]Listing 10-3 A procedure that uses OSAScriptError to get information about an execution errorSaving Script DataStorage Formats for Script Data/Figure 10-1 A generic storage descriptor record:Figure 10-2 A component-specific storage descriptor record'Resource and File Types for Script Data!Loading and Executing Script DatauListing 10-4 A routine that loads and executes script data previously saved using a generic storage descriptor record+Modifying and Recompiling a Compiled ScriptTListing 10-5 A routine that displays a compiled script for editing and recompiles ittListing 10-6 A function that loads and modifies script data, then saves it using a generic storage descriptor record/Using a Script Context to Handle an Apple EventLListing 10-7 A general Apple event handler that uses the OSADoEvent function$Supplying a Resume Dispatch Function(Supplying an Alternative Active Function/Supplying Alternative Create and Send FunctionsAlternative Create FunctionsAlternative Send FunctionsRecording ScriptsWriting a Scripting ComponentScripting Components ReferenceData Structures%Required Scripting Component RoutinesSaving and Loading Script Data"Executing and Disposing of Scripts&Setting and Getting Script Information Manipulating the Active Function%Optional Scripting Component RoutinesCompiling ScriptsGetting Source DataCoercing Script Values*Manipulating the Create and Send FunctionsRecording ScriptsExecuting Scripts in One StepManipulating Dialects,Using Script Contexts to Handle Apple EventsAppleScript Component RoutinesInitializing AppleScript*Getting and Setting Styles for Source Data$Generic Scripting Component Routines3Getting and Setting the Default Scripting Component!Using Component-Specific Routines%Routines Used by Scripting Components<Manipulating Trailers for Generic Storage Descriptor RecordsApplication-Defined RoutinesSummary of Scripting Components)Program-to-Program Communications ToolboxAbout the PPC Toolbox#Ports, Sessions, and Message Blocks:Figure 11-1 A PPC Toolbox session between two applications!Setting Up Authenticated Sessions8Figure 11-2 The icon for the Sharing Setup control panel+Figure 11-3 The Sharing Setup control panel-Figure 11-4 The session termination alert box+Figure 11-5 The users and groups dialog box*Figure 11-6 The user termination alert box Figure 11-7 The guest dialog box2Figure 11-8 The PPC Toolbox authentication processUsing the PPC ToolboxDListing 11-1 Initializing the PPC Toolbox using the PPCInit functionGFigure 11-9 Database and spreadsheet applications using the PPC ToolboxPPC Toolbox Calling Conventions(Specifying Port Names and Location NamesEFigure 11-10 Two Macintosh applications and their corresponding portsAFigure 11-11 The PPC Toolbox and a dictionary service applicationOpening a PortListing 11-2 Opening a PPC port7Browsing for Ports Using the Program Linking Dialog Box+Figure 11-12 The program linking dialog box?Figure 11-13 The program linking dialog box without a zone list)Listing 11-3 Using a port filter function6Listing 11-4 Browsing through dictionary service ports#Obtaining a List of Available PortsFListing 11-5 Using the IPCListPorts function to obtain a list of portsPreparing for a SessionInitiating a PPC Session)Figure 11-14 The user identity dialog box.Figure 11-15 The incorrect password dialog box-Figure 11-16 The invalid user name dialog boxIListing 11-6 Using the StartSecureSession function to establish a session=Listing 11-7 Initiating a session using the PPCStart functionReceiving Session RequestsNListing 11-8 Using the PPCInform function to enable a port to receive sessions8Listing 11-9 Completion routine for a PPCInform function'Accepting or Rejecting Session RequestsFListing 11-10 Accepting a session request using the PPCAccept function9Listing 11-11 Completion routine for a PPCAccept functionFListing 11-12 Rejecting a session request using the PPCReject function9Listing 11-13 Completion routine for a PPCReject function$Exchanging Data During a PPC Session(Figure 11-17 Transmitting message blocks Reading Data From an ApplicationFListing 11-14 Using the PPCRead function to read data during a sessionYListing 11-15 Polling the ioResult field to determine if a PPCRead function has completedSending Data to an ApplicationHListing 11-16 Using the PPCWrite function to write data during a sessionZListing 11-17 Polling the ioResult field to determine if a PPCWrite function has completed#Ending a Session and Closing a Port<Listing 11-18 Ending a PPC session using the PPCEnd function<Listing 11-19 Closing a PPC port using the PPCClose functionInvalidating UsersQListing 11-20 Using the DeleteUserIdentity function to invalidate a user identityPPC Toolbox ReferenceData StructuresThe PPC Toolbox Parameter Block-Figure 11-18 The PPC Toolbox parameter blocksThe PPC Port RecordThe Location Name RecordThe Port Information RecordPPC Toolbox RoutinesInitializing the PPC Toolbox$Using the Program Linking Dialog BoxObtaining a List of PortsOpening and Closing a PortStarting and Ending a Session-Receiving, Accepting, and Rejecting a SessionReading and Writing Data/Locating a Default User and Invalidating a UserApplication-Defined Routines,Completion Routines for PPC Toolbox RoutinesPort Filter FunctionsSummary of the PPC ToolboxData Access ManagerAbout the Data Access Manager(Figure 12-1 A connection with a databaseThe High-Level Interface9Figure 12-2 Using high-level Data Access Manager routines0Sending a Query Through the High-Level Interface0Retrieving Data Through the High-Level InterfaceThe Low-Level Interface8Figure 12-3 Using low-level Data Access Manager routines/Sending a Query Through the Low-Level Interface/Retrieving Data Through the Low-Level Interface5Comparison of the High-Level and Low-Level InterfacesUsing the Data Access Manager!Executing Routines Asynchronously)General Guidelines for the User InterfaceKeep the User in ControlProvide Feedback to the UserUsing the High-Level InterfaceCFigure 12-4 A flowchart of a session using the high-level interface+Listing 12-1 Using the high-level interface$Listing 12-2 Two completion routines1Writing a Status Routine for High-Level Functions$Listing 12-3 A sample status routineUsing the Low-Level InterfaceBFigure 12-5 A flowchart of a session using the low-level interface%Listing 12-4 Sending a query fragment*Listing 12-5 Using the low-level interface.Getting Information About Sessions in ProgressProcessing Query ResultsGetting Query ResultsDTable 12-1 Data types defined by the Data Access Manager (continued) Converting Query Results to TextListing 12-6 A result handlerCreating a Query Document-User Interface Guidelines for Query Documents'Figure 12-6 A query document dialog boxContents of a Query DocumentWFigure 12-7 The relationship between resources in a query document and the query recordLFigure 12-8 The relationship between a query definition function and queries!Query Records and Query Resources#Writing a Query Definition Function(Listing 12-7 A query definition functionData Access Manager ReferenceData Structures The Asynchronous Parameter BlockThe Query RecordThe Results RecordData Access Manager Routines$Initializing the Data Access Manager.High-Level Interface: Handling Query Documents,High-Level Interface: Handling Query Results,Low-Level Interface: Controlling the Session2Low-Level Interface: Sending and Executing Queries'Low-Level Interface: Retrieving Results'Installing and Removing Result HandlersApplication-Defined Routines ResourcesThe Query Resource;Figure 12-9 Structure of a compiled query ('qrsc') resourceThe Query String ResourceCFigure 12-10 Structure of a compiled query string ('wstr') resource&The Query Definition Function Resource"Summary of the Data Access ManagerGlossaryIndex